<me:UIGBMOV x:Class="WPFExcelReport.TYLGBMOV"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIGBMOV.Resources>
        <CollectionViewSource  x:Key="vwMaster" />
        <ucd:BGColorConverter  x:Key="BG2color"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TRIMGB2312Convert8859P1 x:Key="tugb"/>
    </me:UIGBMOV.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0">
            <WrapPanel Height="34">
                <Label Content="{Binding Source={Localization:Translate Word=库}}"    Width="Auto" Margin="1,0,0,0"   FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding LO,ElementName=TV}"  Width="35" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         CharacterCasing="Upper" MaxLength="20"  FontSize="18"   Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=库区}}"    Width="Auto" Margin="1,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding LB,ElementName=TV}" Width="38" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         CharacterCasing="Upper" MaxLength="20" FontSize="18"   Foreground="#FF141111" />
                <Label Width="Auto"  VerticalAlignment="Center" Content="{Binding Source={Localization:Translate Word=批号}}" FontSize="18" />
                <TextBox Text="" Name="txtART" Width="128" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         CharacterCasing="Upper" MaxLength="20" FontSize="18"   Foreground="#FF141111" />
                <Label Width="Auto"  VerticalAlignment="Center" Content="{Binding Source={Localization:Translate Word=缸号}}" FontSize="18" />
                <TextBox Text="" Name="txtFART"  Width="128" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"  
                         CharacterCasing="Upper" MaxLength="20" FontSize="18"   Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=日期从}}"   HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"  Width="Auto" FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0"  FontSize="16"   Panel.ZIndex="4" 
                            Text="{Binding FROMDATE,ElementName=TV}" SelectedDateChanged ="FROM_DATE_SelectedDateChanged"  />
                <Label Content="{Binding Source={Localization:Translate Word=到}}" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0"   Width="Auto" FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,0,0,0"   VerticalAlignment="Center" FontSize="16"  Panel.ZIndex="5"
                                  Text="{Binding ENDDATE,ElementName=TV}"    SelectedDateChanged ="END_DATE_SelectedDateChanged" />
                <Button Content="{Binding Source={Localization:Translate Word=查询}}" Height="33" Margin="10,0,0,0" FontSize="18"  Width="96" Panel.ZIndex="9"
                        Click="QueryCommand"/>
                <Button Content="{Binding Source={Localization:Translate Word=导出}}" Height="33" Margin="10,0,0,0" FontSize="18"  Width="100" Panel.ZIndex="10"
                    Click="PrintCommand"   />
            </WrapPanel>
        </StackPanel>
        <Grid Grid.Row="1" Grid.Column="0">   
        <DataGrid  VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"
                   Name="dlgMaster"
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                    >
                <DataGrid.Resources>
                    <Style TargetType="DataGridRow">
                        <Setter Property="Background" Value="{Binding GPGART,Converter={StaticResource BG2color},Mode=OneWay}"/>
                    </Style>
                </DataGrid.Resources>
                <DataGrid.Columns>
                    <!--GLPARTIE	GLLO	GLLB	GPGART	GPGVAR	GPGFARBE	GPSPPART	GPFBPART	GPZWPART	GPEINDAT	
                GPLIEFSCH	PART ORGIN	SUPP	INKG	INSP	POIKG	POISP	PDIKG	PDISP	MUIKG	MUISP	STIKG	STISP	SOIKG	SOISP	
                MUOKG	MUOSP	SMOKG	SMOSP	STOKG	STOSP	SOOKG	SOOSP	OUTKG	OUTSP-->
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=入库号}}" Binding="{Binding GLPARTIE}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=库}}" Binding="{Binding GLLO}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=区}}" Binding="{Binding GLLB}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding MATTYP,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纱线编号}}" Binding="{Binding GPGART,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=变量}}" Binding="{Binding GPGVAR}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding GPGFARBE,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纺批}}" Binding="{Binding GPSPPART,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=缸号}}" Binding="{Binding GPFBPART,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=单价}}" Binding="{Binding GPZWPART,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=最早入库日期}}" Binding="{Binding GPEINDAT}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=等级}}" Binding="{Binding GPLIEFSCH,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=完整纺批}}" Binding="{Binding PART,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=产地}}" Binding="{Binding ORGIN,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=供应商}}" Binding="{Binding SUPP,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=期初KG}}" Binding="{Binding INKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=期初包数}}" Binding="{Binding INSP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=采购KG}}" Binding="{Binding POIKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=采购包数}}" Binding="{Binding POISP}" Width="Auto"/>
                    <!--DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产KG}}" Binding="{Binding PDIKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产包数}}" Binding="{Binding PDISP}" Width="Auto"/-->
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=手工入KG}}" Binding="{Binding MUIKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=手工入包数}}" Binding="{Binding MUISP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产退料KG}}" Binding="{Binding STIKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产退料包数}}" Binding="{Binding STISP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=外库转入KG}}" Binding="{Binding EXIKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=外库转入包数}}" Binding="{Binding EXISP}" Width="Auto"/>
                    <!--DataGridTextColumn Header="{Binding Source={Localization:Translate Word=销售退KG}}" Binding="{Binding SOIKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=销售退包数}}" Binding="{Binding SOISP}" Width="Auto"/-->
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=手调整KG}}" Binding="{Binding MUOKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=手调整包数}}" Binding="{Binding MUOSP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=免费样纱KG}}" Binding="{Binding SMOKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=免费样纱包数}}" Binding="{Binding SMOSP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=发生产KG}}" Binding="{Binding STOKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=发生产包数}}" Binding="{Binding STOSP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=转外厂KG}}" Binding="{Binding EXOKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=转外厂包数}}" Binding="{Binding EXOSP}" Width="Auto"/>
                    <!--DataGridTextColumn Header="{Binding Source={Localization:Translate Word=销售出KG}}" Binding="{Binding SOOKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=销售出包数}}" Binding="{Binding SOOSP}" Width="Auto"/-->
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=期末KG}}" Binding="{Binding OUTKG}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=期末包数}}" Binding="{Binding OUTSP}" Width="Auto"/>
                    <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=备注}}" Binding="{Binding REMARK,Converter={StaticResource ResourceKey=tugb }}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid>
        </Grid>
        <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
    </Grid>
</me:UIGBMOV> 
 
